document.write(" <script src=\"/static/vue/wrapVue.js\"></script>");
document.write("  <script src=\"/static/axios.min.js\"></script>  ");

function selectMenu(event) {
    console.log("event", event);
    window.location.href = "/index" + event;
}

function startLoading() {
    return ElementPlus.ElLoading.service({
        fullscreen: true,
        background: 'rgba(0, 0, 0, 0.7)',
        lock: true,
    });
}

function showMessage(type, mesage, duration) {
    if (!!duration) {
        duration = 3000;
    }
    ElementPlus.ElMessage({
        message: mesage,
        grouping: true,
        type: type,
        duration: duration,
        showClose: true,
    });
}

function confirmMsg(msg, okFunc, cancelFunc, useHtml) {
    if (!useHtml) {
        useHtml = false;
    }
    if (useHtml) {
        msg = msg.replaceAll("\\n", "<br/>");
    }
    ElementPlus.ElMessageBox.confirm(msg, "",
        {
            dangerouslyUseHTMLString: useHtml,
        })
        .then(() => {
            if (typeof okFunc === "function") {
                okFunc();
            }
        })
        .catch(() => {
            // catch error
            if (typeof cancelFunc === "function") {
                cancelFunc();
            }
        })
}
